package com.cn.lyl.dao.impl;

import com.cn.lyl.dao.LawyerRoleDependenceDao;
import com.cn.lyl.model.LawyerRoleDependenceModel;
import com.cn.lyl.util.JDBC;

import java.util.List;

public class LawyerRoleDependenceDaoImpl implements LawyerRoleDependenceDao {
    @Override
    public int add(LawyerRoleDependenceModel lawyerRoleDependenceModel) {

        String sql ="INSERT INTO lawyer_role_dependence (lawyer_id,role_id,create_time, update_time, enable, remark)" +
                "VALUES ("+lawyerRoleDependenceModel.getLawyerId()+","+lawyerRoleDependenceModel.getRoeId()+",now(),now(),1,'')";
        System.out.println(sql);
        return JDBC.update(sql);
    }

    @Override
    public int update(LawyerRoleDependenceModel LawyerRoleDependenceModel) {
        return 0;
    }

    @Override
    public int delete(LawyerRoleDependenceModel lawyerRoleDependenceModel) {
        String sql ="delete from lawyer_role_dependence where layer_id ="+lawyerRoleDependenceModel.getLawyerId();
        return JDBC.update(sql);
    }

    @Override
    public LawyerRoleDependenceModel findById(int id) {
        return null;
    }

    @Override
    public List<LawyerRoleDependenceModel> findAll(LawyerRoleDependenceModel LawyerRoleDependenceModel) {
        return null;
    }
}
